package com.example.jikeyoujikeyou.office_sz.model.base;


import com.example.jikeyoujikeyou.office_sz.model.Department;

import java.util.ArrayList;
import java.util.List;

public class BaseCompany extends BaseModel {

    private String id;

    public BaseCompany() {
    }

    private String name;

    private String address;


    private String telephone;


    private Integer scale;


    private String createTime;

    private List<Department> departments;

    /**
     * 构造方法.
     *
     * @param json
     */
    public BaseCompany(String json) {
        super(json);
    }

    public String getId() {
        if (null == id) {
            return (String) get("id");
        }
        return id;
    }

    public List<Department> getDepartments() {
        if (null == departments) {
            departments = (List<Department>) get("id");
        }
        if (null == departments) {
            departments = new ArrayList<>();
        }
        return departments;
    }

    public void setId(String id) {
        this.put("id", id);
        this.id = id;
    }

    public String getName() {
        if (null == name) {
            return (String) get("name");
        }
        return name;
    }

    public void setName(String name) {
        this.put("name", name);
        this.name = name;
    }

    public String getAddress() {
        if (null == address) {
            return (String) get("address");
        }
        return address;
    }

    public void setAddress(String address) {
        this.put("address", address);
        this.address = address;
    }

    public String getTelephone() {
        if (null == telephone) {
            return (String) get("telephone");
        }
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.put("telephone", telephone);
        this.telephone = telephone;
    }

    public Integer getScale() {
        if (null == scale) {
            return (Integer) get("scale");
        }
        return scale;
    }

    public void setScale(Integer scale) {
        this.put("scale", scale);
        this.scale = scale;
    }

    public void setDepartments(List<Department> departments) {
        this.put("departments", departments);
        this.departments = departments;
    }

    public String getCreateTime() {
        if (null == createTime) {
            return (String) get("createTime");
        }
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.put("createTime", createTime);
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "BaseCompany{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", address='" + address + '\'' +
                ", telephone='" + telephone + '\'' +
                ", scale=" + scale +
                ", createTime='" + createTime + '\'' +
                ", departments=" + departments +
                '}';
    }
}